import { postService, postServiceList } from '.'
import { PORT1 } from '../config/net.config'
import { Member } from './interface/member'

// 会员等级
export const getMemberGradeAPI = (params: {}) => {
  return postServiceList<Member.MemberGrade>(`${PORT1}/CoreCmsUserGrade/GetPageList`, params, false)
}
export const createMemberGradeAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserGrade/DoCreate`, params, 'json')
}
export const editMemberGradeAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserGrade/DoEdit`, params, 'json')
}
export const deleteMemberGradeAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserGrade/DoDelete`, params, 'json')
}
export const getMemberGradeIndexAPI = (params: {}) => {
  return postService<number>(`${PORT1}/CoreCmsUserGrade/GetIndex`, params, 'json')
}

// 会员资料
export const getMemberInfoAPI = (params: {}) => {
  return postServiceList<Member.MemberInfo>(`${PORT1}/CoreCmsUser/GetPageList`, params, false)
}
export const createMemberInfoAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUser/DoCreate`, params, 'json')
}
export const editMemberInfoAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUser/DoEdit`, params, 'json')
}
export const deleteMemberInfoAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUser/DoDelete`, params, 'json')
}

// 会员分类
export const getMemberCategoryAPI = (params: {}) => {
  return postServiceList<Member.MemberCategory>(`${PORT1}/CoreCmsUserCategory/GetPageList`, params, false)
}
export const createMemberCategoryAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserCategory/DoCreate`, params, 'json')
}
export const editMemberCategoryAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserCategory/DoEdit`, params, 'json')
}
export const deleteMemberCategoryAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserCategory/DoDelete`, params, 'json')
}
export const rechargeAPI = (params: Member.Recharge) => {
  return postService<null>(`${PORT1}/CoreCmsUser/DoEditBalance`, params, 'json')
}

// 充值规则
export const getRefillRuleAPI = (params: {}) => {
  return postServiceList<Member.RefillRule>(`${PORT1}/CoreCmsUserDepositRules/GetPageList`, params, false)
}
export const createRefillRuleAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserDepositRules/DoCreate`, params, 'json')
}
export const editRefillRuleAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserDepositRules/DoEdit`, params, 'json')
}
export const deleteRefillRuleAPI = (params: {}) => {
  return postService<null>(`${PORT1}/CoreCmsUserDepositRules/DoDelete`, params, 'json')
}
